<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class Student extends Model
{
    public $table = 'students';

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'name',
        'school_id',
        'sex',
        'nation',
        'police_station_id',
        'twins',
        'id_code',
        'entity_id',
        'relation',
        'prophylactic_code',
        'registration_numbers',
        'section_id',
        'is_enroll',
        'first_kid'
    ];

    public function policeStation(){
        return $this->hasOne(PoliceStation::class,'id','section_id');

    }

    public function school(){
        return $this->hasOne(School::class,'school_code','school_id');

    }

    public function entity(){
        return $this->hasOne(Entity::class,'id','entity_id');

    }

}
